"
An EmbeddedFreeTypeFontInstallerTest is a test class for testing the behavior of EmbeddedFreeTypeFontInstaller
"
Class {
	#name : 'EmbeddedFreeTypeFontInstallerTest',
	#superclass : 'TestCase',
	#category : 'EmbeddedFreeType-Tests-Installation',
	#package : 'EmbeddedFreeType-Tests',
	#tag : 'Installation'
}

{ #category : 'accessing' }
EmbeddedFreeTypeFontInstallerTest >> currentInstallerOrError [
	| installer |
	installer := EmbeddedFreeTypeFontInstaller readSlotNamed: #current.
	self assert: installer isNotNil.
	^ installer
]

{ #category : 'accessing' }
EmbeddedFreeTypeFontInstallerTest >> currentProviderOrError [
	| provider |
	provider := FreeTypeFontProvider readSlotNamed: #current.
	self assert: provider isNotNil.
	^ provider
]

{ #category : 'tests' }
EmbeddedFreeTypeFontInstallerTest >> testIsRegistred [
	| installer provider |
	installer := self currentInstallerOrError.
	provider := self currentProviderOrError.
	self assert: (provider includesInstaller: installer)
]

{ #category : 'tests' }
EmbeddedFreeTypeFontInstallerTest >> testinstallAllFontsIn [

	| provider fileInfos families |
	provider := self currentProviderOrError
								updateEmbeddedFreeTypeFonts;
								yourself.
	fileInfos := provider fileInfosByFamilyAndGroup.

	self
		assert: fileInfos keys size > 1;
		assert: (fileInfos includesKey: 'Source Sans Pro');
		assert: (fileInfos includesKey: 'Source Code Pro').

	families := provider families.

	self
		assert: (families includesKey: 'Source Sans Pro');
		assert: (families includesKey: 'Source Code Pro')
]
